﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace XRM.Security.DataAccess.Models
{
    [Table("IdentityCenter")]
    public class IdentityCenter
    {
        public IdentityCenter()
        {
            Files = new List<IdentityCenterCert>();
            IdentityCenterInfoSystems = new List<IdentityCenterInfoSystem>();
            IsDeleted = false;
        }

        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int IdentityCenterId { get; set; }

        [Required]
        [MaxLength(100)]
        public string IdentityCenterName { get; set; }

        [MaxLength(200)]
        public string Address { get; set; }
        
        [MaxLength(500)]
        public string Contact { get; set; }

        [Required]
        [DefaultValue(false)]
        public bool IsDeleted { get; set; }
        
        public virtual ICollection<IdentityCenterCert> Files { get; set; }
        public virtual ICollection<IdentityCenterInfoSystem> IdentityCenterInfoSystems { get; set; }
    } 
}